import React, { Component } from 'react';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import "./scss/App.scss";
import routes from './route/routes';

class App extends Component {
    render() {
        return (
            <BrowserRouter>
                <div>
                    <Switch>
                        {
                            routes.map((page, index) => page.component ?
                            <Route key={index} exact path={page.path} component={page.component}/> : "")
                        }
                    </Switch>
                </div>
            </BrowserRouter>
        );
    }
};

export default App;
